//# sourceURL=http://uMapApp/UI/ModalityLoading
define([
    "mhjs/mhjs",
    "uMap/uMap"
], function (
    mhjs,
    uMap
) {

    function ModalityLoading(option) {

        var _this = this;
        _this.isOpened = false;

        _this.ui = {
            loading: new mhjs.Div({"class": "loading"}),
            info   : new mhjs.Div({"class": "info"})
        };

        mhjs.Div.call(_this, option);
        _this.addClass("modalityLoading");

        _this
            .append(_this.ui.loading)
            .append(_this.ui.info)
        ;

    }

    var _class = ModalityLoading;
    mhjs.Inherit(_class, mhjs.Div);


    Object.defineProperties(_class.prototype, {
        "info"  : {
            get: function () {
                return this._info;
            },
            set: function (info) {

                var _this = this;
                _this._info = info;
                _this.ui.info.text(info);

            }
        },
        "open"  : {
            value: function () {
                var _this = this;
                _this.isOpened = true;
                _this.addClass("open");
            }
        },
        "close" : {
            value: function () {
                var _this = this;
                _this.isOpened = false;
                _this.removeClass("open");
            }
        },
        "toggle": {
            value: function () {
                var _this = this;
                if (_this.isOpened) {
                    _this.close();
                } else {
                    _this.open();
                }
            }
        }
    });

    return _class;

});